package com.mooc.lib_video.adapter

import android.widget.ImageView
import com.blankj.utilcode.util.TimeUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.mooc.lib_common.model.CommentEntity
import com.mooc.lib_network.imgload.ImageLoad
import com.mooc.lib_video.R

class HomeVideoCommentAdapter : BaseQuickAdapter<CommentEntity,BaseViewHolder>(R.layout.layout_feed_comment_list_item) {

    override fun convert(holder: BaseViewHolder, item: CommentEntity) {
        var avatar = holder.getView<ImageView>(R.id.author_avatar)
        ImageLoad.loadMatch(item.avatar,avatar)
        holder.setText(R.id.author_name,item.name)
        holder.setText(R.id.create_time, TimeUtils.millis2String(item.createTime))
        holder.setText(R.id.comment_text,item.commentText)
    }

}